home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amoszine 3
/
Amoszine 3.adf
/
MORE_SOURCE
/
File_Examine.AMOS
/
File_Examine.amosSourceCode
Wrap
AMOS Source Code
|
1992-02-26
|
3KB
|
135 lines
' *************************
' *** FILE EXAMINE v1.1 ***
' *************************
' *** This routine reads the header of a file and trys to determine which
' type of file it is e.g. IFF Picture, Sample Etc!
' *** Open Screen.
Screen Open 0,640,200,2,Hires
Curs Off
Flash Off
Cls 0
' *** Set Palette.
Palette $0,$FFC
' *** Select File.
F$=Fsel$("","","FILE TO EXAMINE")
If F$="" or Not Exist(F$)
Goto FIN
End If
' *** Examine File..
Proc _EXAMINE_FILE[F$]
FT$=Param$
' *** Print File Type.
Print F$
Print
Print "File Type = ";FT$
' *** Quit.
FIN:
End
' *** This Procedure Examines A Files Header, Which Determines What Type
' Of File It Is e.g. IFF PICTURE, ANIMATION Etc!
Procedure _EXAMINE_FILE[F$]
' *** Read File Header.
Open In 1,F$
LF=Lof(1)
HEAD$=Input$(1,Min(LF,$440))
Close 1
' *** Determine File Type.
Restore DAT
Repeat
Read S1,H1$,S2,H2$,FT$
If Mid$(HEAD$,S1,Len(H1$))=H1$ and Mid$(HEAD$,S2,Len(H2$))=H2$
OK=1
Exit
End If
Until H1$="END"
' *** Check For ASCII Format.
If H1$="END"
C=0
For N=1 To Len(HEAD$)
A=Asc(Mid$(HEAD$,N,1))
If A>=32 or A=10 or A=9
Inc C
End If
Next N
P=(C*100)/Len(HEAD$)
If P>95
FT$="ASCII TEXT"
End If
End If
' *** File Header Data (Start1, Header1, Start2, Header2, File Type).
DAT:
Data 1,"FORM",9,"ILBM","IFF PICTURE"
Data 1,"FORM",9,"SMUS","IFF MUSIC (AEGIS SONIX)"
Data 1,"FORM",9,"8SVX","IFF SAMPLE"
Data 1,"FORM",9,"ANIM","IFF ANIMATION"
Data 1,"FORM",9,"SC3D","SCULPT 3D SCENE"
Data 1,"AmSp",1,"","AMOS BOB BANK"
Data 1,"AmIc",1,"","AMOS ICON BANK"
Data 1,"AmBk",13,"Music","AMOS MUSIC BANK"
Data $439,"M.K.",1,"","SOUNDTRACKER MODULE"
Data $439,"FLT4",1,"","SOUNDTRACKER MODULE"
Data 1,"MMD1",1,"","MED MODULE"
Data 1,"MMD0",1,"","MED MODULE"
Data 1,"AmBk",13,"Tracker","SOUNDTRACKER MODULE IN AN AMOS BANK"
Data 1,"AmBk",13,"Pac.Pic","AMOS PAC PIC"
Data 1,"AmBk",13,"Samples","AMOS SAMPLE BANK"
Data 1,"AmBk",13,"Menu","AMOS MENU BANK"
Data 1,"AmBk",13,"Amal","AMOS AMAL BANK"
Data 1,"AmBk",13,"Data","AMOS DATA BANK"
Data 1,"AmBk",1,"","AMOS BANK"
Data 1,"AmBs",1,"","SET OF AMOS BANKS"
Data 1,"AMOS Basic",1,"","AMOS 1.3 PROGRAM"
Data 1,"AMOS Pro",1,"","AMOS PROFESSIONAL PROGRAM"
Data 1,Chr$(0)+Chr$(0)+Chr$(3)+Chr$($F3),1,"","AMIGADOS EXECUTABLE PROGRAM"
Data 1,"PP20",1,"","POWERPACKEDDATA FILE"
Data 1,"MED"+Chr$(4),1,"","OCTAMED MODULE"
Data 1,"MSH"+Chr$(0),1,"","OCTAMED SYNTHSOUND"
Data 1,Chr$(227)+Chr$(16)+Chr$(0)+Chr$(1),1,"","WORKBENCH ICON"
Data 1,"PPbk",1,"","AMOS POWERPACKED BANK"
Data 1,Chr$(255)+Chr$(216)+Chr$(255)+Chr$(224),119,"JPEG","JPEG PICTURE"
Data 1,"DMS!",1,"","DISKMASHER FILE"
Data 1,"xSceneEditor",1,"","MOVIESETTER MOVIE WITH DATA"
Data 1,"FILM",1,"","MOVIESETTER MOVIE WITHOUT DATA"
Data 1,"SMOD",1,"","FUTURE COMPOSER V1.0-V1.3"
Data 365,"DELTA MUSIC V2.0",0,"","DELTA MUSIC V2.0"
Data 1,"DM20",1,"","DATAMASTER V2.0 DATABASE"
Data 1,"MM"+Chr$(0)+"*",1,"","TIFF PICTURE"
Data 5,"DEBR",27,"CHAG","FREELANCE V2.0 PRESENTATION"
Data 1,Chr$(10)+Chr$(5)+Chr$(1),1,"","PCX PICTURE"
Data 1,"BM",15,"(","WINDOWS BITMAP (BMP)"
Data 1,"END",1,"","UNKNOWN FILE TYPE"
End Proc[FT$]